// Mongoose的一切都始于一个Schema。每个schema映射到MongoDB的集合(collection)和定义该集合(collection)中的文档的形式
const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    title:{type : String},
    body:{type:String},
    categories:[{type:mongoose.SchemaTypes.ObjectId,ref:'Category'}]
},{
    timestamps:true
})

 
module.exports = mongoose.model('Article',schema)